package Demo1;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: DELL
 * Date: 2022-09-21
 * Time: 9:45
 */
public class Test_MarrayList {

    public static void main(String[] args) {
        MyArrayList myArrayList = new MyArrayList();
        myArrayList.add(1);
        myArrayList.add(2);
        myArrayList.add(3);
        myArrayList.add(4);
        myArrayList.add(5);
        myArrayList.add(6);
        myArrayList.add(3);
        myArrayList.add(8);
        myArrayList.add(9);
        myArrayList.add(10);

        try {
            myArrayList.add(10,11);
            myArrayList.add(2,99);
            System.out.println();
        }catch (RuntimeException e){
            e.printStackTrace();
        }
        myArrayList.display();

        try {
            System.out.println(myArrayList.contains(99));
            System.out.println(myArrayList.contains(88));
            System.out.println("============");
            System.out.println(myArrayList.indexOf(99));
            System.out.println(myArrayList.indexOf(77));

        }catch (RuntimeException e){
            e.printStackTrace();
        }

        myArrayList.set(2,100);
        myArrayList.display();

        System.out.println("================");
        myArrayList.remove(3);
        myArrayList.display();
    }
}
